package org.jeecg.modules.meter.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.entity.charge.ChargeFeeitem;
import org.jeecg.entity.meter.MeterFee;

import java.util.List;

/**
 * @Description: 仪表费用项绑定关系表
 * @Author: jeecg-boot
 * @Date:   2020-11-20
 * @Version: V1.0
 */
public interface MeterFeeMapper extends BaseMapper<MeterFee> {

    @SqlParser(filter = true)
    List<MeterFee> getByMeterIdList(@Param("meterIds") List<String> meterIds);

    void deleteByMeterId(@Param("meterId") String id);

    List<MeterFee> queryFeeList(@Param("isBind") int i,@Param("meterId") String id);
    @Update("update meter_fee set is_bind ='0' where id =#{meterId} and del_flag ='0'")
    void untieFeeByMeterId(@Param("meterId") String id);

    List<String> queryFeeItemNameByMeterId(@Param("meterId") String id);
    @Select("select * from charge_feeitem")
    List<ChargeFeeitem> getChargeFeeItem();
}
